<?php
@session_start();
/*
*@	访客  2015/12/25 星期五
*@	访客制器
*/
require_once('./hyang/config/config.ini.php');
require_once('upmklog.php');
require_once('hyang.function.php');
require_once dirname(__FILE__).'./hyang/ControllerAbstract.php';

loadApp('guest');
spl_autoload_register('loadApp');
/*>>>>>>>>>>>>>>>>>>*-/
//新语句	:方案1
if(isset($_GET['model']) && $_GET['model'] != ''){
	modelTo($_GET['model']);
}
else{
	$sid = (isset($_SESSION['sid'])? $_SESSION['sid'] : '');
	if(isset($_GET['sid'])) $sid = $_GET['sid'];
	echo pageTo('guest',$sid,true);
}
/-*<<<<<<<<<<<<<<<<<<*/

/*
//新方法替换		2016/1/8 星期五  原来实现语句
//		   :方案2
$guest = new guest();
$model = new model();
$c = new C();

$sid = (isset($_SESSION['sid'])? $_SESSION['sid'] : '');
if(isset($_GET['model']) || isset($_POST['model']))//模式
	$sid = (isset($_POST['model'])? $_POST['model']:$_GET['model']);
if(isset($_GET['sid'])) $sid = $_GET['sid'];
switch($sid)
{
	case 'getRight':
		$model -> getRight();
		break;
	case 'register':
		$model -> register();
		break;
	case crypt('getRight','guest'):
		$guest -> getRight();
		break;
	case crypt("register","guest"):
		$guest -> register();
		break;
	default:
		$guest -> index();
}
*/

//		   :方案3(结合前两者，F1不便修改已经实现的功能)
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/


if((isset($_POST['model']) && $_POST['model'] != '') || (isset($_GET['model']) && $_GET['model'] != '')){
	$modelTo = (isset($_POST['model'])? $_POST['model'] : $_GET['model']);
	modelTo($modelTo);
	
}else{
	
	$guest = new guest();
	$sid = (isset($_SESSION['sid'])? $_SESSION['sid'] : '');
	if(isset($_GET['sid']) && $_GET['sid'] != '')
		$sid = $_GET['sid'];
	switch($sid)
	{
		case crypt('getRight','guest'):
			$guest -> getRight();
			break;
		case crypt("register","guest"):
			$guest -> register();
			break;
		case crypt('learn','guest'):
			$guest -> learn();
			break;
		case crypt('template','guest'):
			$guest -> template();
			break;
		case crypt('phpinfos','guest'):
			$guest -> phpinfos();
			break;
		default:
			$guest -> index();
	}
	exit;
}

/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
?>